<template>
  <div id="app">
    <RouterView />
  </div>
</template>

<script setup>
import { reactive, toRefs } from "vue";
import { useRouter, RouterView } from "vue-router";
const router = useRouter();
const state = reactive({
  transitionName: "slide-left",
});
router.beforeEach((to, from) => {
  if (to.meta.index > from.meta.index) {
    state.transitionName = "slide-left"; // 向左滑动
  } else if (to.meta.index < from.meta.index) {
    // 由次级到主级
    state.transitionName = "slide-right";
  } else {
    state.transitionName = ""; // 同级无过渡效果
  }
});
</script>

<style lang="less">
html,
body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
}

#app {
  height: 100%;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  // color: #2c3e50;

}

// .router-view {
//   width: 100%;
//   height: auto;
//   position: absolute;
//   top: 0;
//   bottom: 0;
//   margin: 0 auto;
//   -webkit-overflow-scrolling: touch;
// }

@media (max-width: 750px) {
  ::-webkit-scrollbar {
    display: none;
  }
}
body::-webkit-scrollbar {
    display: none;
  }
.van-badge--fixed {
  z-index: 1000;
}
</style>
